package cate.game.client;

import cate.game.GameBody;
import cate.game.client.request.ClientRequestHandler;
import cate.game.framework.ModuleMan;

/** 客户端模块管理 */
public class ClientManager extends ModuleMan {

    /** 客户端请求管理 */
    public final ClientRequestHandler request = new ClientRequestHandler();
    /** 客户端上下文持有 */
    public final ClientContextHolder contextHolder = new ClientContextHolder();

    @Override
    public void initIndependent(GameBody game) throws Exception {
        super.initIndependent(game);
        request.initIndependent(game);
    }

    @Override
    public void initDependent() throws Exception {
        request.initDependent();
    }

    @Override
    public void shutdown() {
        contextHolder.cid_cc_map.values().forEach(cc -> cc.kickOff(game));
    }
}
